// 求和相关配置
export default {
    namespaced: true,
    actions: {
        jiaodd (context, value) {
            console.log('jiaodd');
            if (context.state.sum % 2) {
                context.commit('JIA', value)
            }
        },
        jiawait (context, value) {
            console.log('jiawait');
            setTimeout(() => {
                context.commit('JIA', value)
            }, 1000)
        }
    },
    mutations: {
        JIA (state, value) {
            console.log('JIA被调用了');
            state.sum += value
        },
        JIAN (state, value) {
            console.log('JIAN被调用了');
            state.sum -= value
        },
    },
    state: {
        sum: 0,
        school: '北大',
        student: '学生',
    },
    getters: {
        bigSum (state) {
            return state.sum * 10
        }
    }
}